import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const basePath = '/vue-app'
// const basePath = ''
const routes: Array<RouteRecordRaw> = [{
    path: '/',
    redirect: basePath + '/index',
}, {
    path: basePath,
    redirect: basePath + '/index',
}, {
    path: basePath + '/index',
    name: 'index',
    component: () => import('@/page/index.vue'),
}]

const router = createRouter({
    history: createWebHistory(),
    // history: createWebHistory('/vue-app'),
    routes,
})

router.beforeEach((to, from, next) => {
    console.log('sub-app-vue router history', history)
    next()
})
export default router
